Skip to content

fix: handle NaN layout widths#178

Closed
hiSandog wants to merge 1 commit into
chenglou:mainfrom
hiSandog:fix/layout-input-width-20260518
Closed

fix: handle NaN layout widths#178
hiSandog wants to merge 1 commit into
chenglou:mainfrom
hiSandog:fix/layout-input-width-20260518

Conversation

@hiSandog
Copy link
Copy Markdown
Contributor

Summary

  • Normalize NaN maxWidth inputs to zero before running public layout APIs
  • Keep layout(), layoutWithLines(), layoutNextLine(), layoutNextLineRange(), walkLineRanges(), and measureLineStats aligned for transient invalid width measurements
  • Add a regression test covering the NaN fallback behavior

Tests

  • bun test src/layout.test.ts
  • bun run check
  • git diff --check

@hiSandog
Copy link
Copy Markdown
Contributor Author

hiSandog commented Jun 4, 2026

Closing this stale PR because it is older than 15 days. I am leaving the branch intact.

@hiSandog hiSandog closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant